<template>
  <div>
    <TbTitle title="一、基本信息" />
    <table class="m-table" border="0">
      <tr>
        <td class="td-head">名称</td>
        <td colspan="8">{{ detailInfo.organizationBaseName }}</td>
      </tr>
      <tr>
        <td class="td-head">业务主管单位/原业务主管单位</td>
        <td colspan="4"><span>{{ detailInfo.supervisoryUnit }}</span></td>
        <td>行业分类</td>
        <td colspan="3"><span>{{ dictToVal(dict4, detailInfo.industryType) }}</span></td>
      </tr>
      <tr>
        <td class="td-head">党建领导机关</td>
        <td colspan="4"><span>{{ detailInfo.leadershipOrganization }}</span></td>
        <td>社会组织类型</td>
        <td colspan="3"><span>{{ dictToVal(dict1, detailInfo.unitNature) }}</span></td>
      </tr>
      <tr>
        <td class="td-head">业务范围</td>
        <td colspan="4">
          {{ detailInfo.businessScope }}
        </td>
        <td>统一社会信用代码</td>
        <td colspan="3">{{ detailInfo.creditCode }}</td>
      </tr>
      <tr>
        <td class="td-head">原登记证号</td>
        <td colspan="10"><span>{{ detailInfo.registerNum }}</span></td>
      </tr>
      <tr>
        <td class="td-head" rowspan="2">法定代表人</td>
        <td>姓名</td>
        <td colspan="2"><span>{{ detailInfo.legalRepresentativeName }}</span></td>
        <td>性别</td>
        <td><span>{{ ['男', '女'][detailInfo.legalRepresentativeSex - 1] }}</span></td>
        <td>出生日期</td>
        <td colspan="2"><span>{{ detailInfo.legalRepresentativeBirthday }}</span></td>
      </tr>
      <tr>
        <td>政治面貌</td>
        <td colspan="2"><span>{{ dictToVal(dict3, detailInfo.legalRepresentativePolitics) }}</span></td>
        <td>学历</td>
        <td><span>{{ dictToVal(dict6, detailInfo.legalRepresentativeEducation) }}</span></td>
        <td>社团职务</td>
        <td colspan="2"><span>{{ dictToVal(dict2, detailInfo.legalRepresentativePost) }}</span></td>
      </tr>
      <tr>
        <td class="td-head">成立时间</td>
        <td colspan="4">{{ detailInfo.establishTime }}</td>
        <td>注册资金</td>
        <td colspan="3">{{ detailInfo.registerCapital }} 万元</td>
      </tr>
      <tr>
        <td class="td-head">住所</td>
        <td colspan="4"><span>{{ detailInfo.registerAddress }}</span></td>
        <td>邮政编码</td>
        <td colspan="3"><span>{{ detailInfo.postalCode }}</span></td>
      </tr>
      <tr>
        <td class="td-head">是否合署办公</td>
        <td colspan="4"><span>{{ yesNoBool(detailInfo.isJoinWork) }}</span></td>
        <td>合署办公的单位名称</td>
        <td colspan="3"><span>{{ detailInfo.joinWork }}</span></td>
      </tr>
      <tr>
        <td class="td-head">办公电话</td>
        <td colspan="4"><span>{{ detailInfo.officePhone }}</span></td>
        <td>对外公开电话</td>
        <td colspan="3"><span>{{ detailInfo.foreignPhone }}</span></td>
      </tr>
      <tr>
        <td class="td-head">网站地址</td>
        <td colspan="4"><span>{{ detailInfo.websiteAddress }}</span></td>
        <td>电子邮件</td>
        <td colspan="3"><span>{{ detailInfo.email }}</span></td>
      </tr>
      <tr>
        <td class="td-head">联系人</td>
        <td colspan="2">姓名</td>
        <td><span>{{ detailInfo.contactsName }}</span></td>
        <td colspan="2">职务</td>
        <td><span>{{ dictToVal(dict2, detailInfo.contactsPost) }}</span></td>
        <td>联系电话</td>
        <td><span>{{ detailInfo.contactsTelephone }}</span></td>
      </tr>
      <tr>
        <td class="td-head">会员</td>
        <td colspan="2">单位会员数量</td>
        <td colspan="2"><span>{{ detailInfo.unitMemberNum }}</span></td>
        <td colspan="2">个人会员数量</td>
        <td colspan="2"><span>{{ detailInfo.personalMemberNum }}</span></td>
      </tr>
      <tr>
        <td class="td-head">章程规定的最高权力机构</td>
        <td colspan="8"><span>{{ ['会员大会', '会员代表大会'][detailInfo.rulesProvidePowerDept - 1] }}</span></td>
      </tr>
      <tr>
        <td class="td-head" rowspan="8">理事会及负责人</td>
        <td rowspan="2">理事长(会长)</td>
        <td colspan="2">姓名</td>
        <td class="width-td"><span>{{ detailInfo.chairmanName }}</span></td>
        <td>联系方式</td>
        <td><span>{{ detailInfo.chairmanPhone }}</span></td>
        <td>任职时间</td>
        <td class="width-td" style="width: 100px;"><span>{{ detailInfo.chairmanAppointTime }}年</span></td>
      </tr>
      <tr>
        <td colspan="3">(原)工作单位及职务</td>
        <td colspan="4"><span>{{ detailInfo.chairmanDirectorUnitPosition }}</span></td>
      </tr>
      <tr>
        <td rowspan="2">秘书长</td>
        <td colspan="2">姓名</td>
        <td class="width-td"><span>{{ detailInfo.secretaryName }}</span></td>
        <td>联系方式</td>
        <td><span>{{ detailInfo.secretaryPhone }}</span></td>
        <td>任职时间</td>
        <td class="width-td"><span>{{ detailInfo.secretaryAppointTime }}</span></td>
      </tr>
      <tr>
        <td colspan="2">产生方式</td>
        <td colspan="2"><span>{{ dictToVal(dict5, detailInfo.secretaryDirectorGenerateWay) }}</span></td>
        <td>是否专职</td>
        <td colspan="3"><span>{{ yesNoBool(detailInfo.secretaryDirectorFullTime) }}</span></td>
      </tr>
      <tr>
        <td colspan="4">现职公务员兼任负责人</td>
        <td colspan="4">
          省部级及以上（
          <span>{{ detailInfo.incumbentResponsibleMinisterialNum }}</span>
          ）人；地厅级（
          <span>{{ detailInfo.incumbentResponsibleDepartmentNum }}</span>
          ）人；县处级(
          <span>{{ detailInfo.incumbentResponsibleCountyNum }}</span>
          )人
        </td>
      </tr>
      <tr>
        <td colspan="4">退（离）休领导干部担任负责人</td>
        <td colspan="4">
          兼任省部级及以上（
          <span>{{ detailInfo.retireResponsibleMinisterialNum }}</span>
          ）人；兼任地厅级（
          <span>{{ detailInfo.retireResponsibleDepartmentNum }}</span>
          ）人；兼任县处级(
          <span>{{ detailInfo.retireResponsibleCountyNum }}</span>
          )人
        </td>
      </tr>
      <tr>
        <td colspan="4">退（离）休领导干部担任理事数</td>
        <td colspan="4">
          省部级及以上（
          <span>{{ detailInfo.retireDirectorMinisterialNum }}</span>
          ）人；地厅级（
          <span>{{ detailInfo.retireDirectorDepartmentNum }}</span>
          ）人；县处级(
          <span>{{ detailInfo.retireDirectorCountyNum }}</span>
          )人
        </td>
      </tr>
      <tr>
        <td>理事会人数</td>
        <td><span>{{ detailInfo.directorPeopleNum }}</span></td>
        <td>常务理事会人数</td>
        <td><span>{{ detailInfo.executiveDirectorPeopleNum }}</span></td>
        <td>负责人数</td>
        <td><span>{{ detailInfo.responsiblePeopleNum }}</span></td>
        <td>70岁以上负责人数</td>
        <td><span>{{ detailInfo.responsibleSeventyPeopleNum }}</span></td>
      </tr>
      <tr>
        <td class="td-head">新闻发言人</td>
        <td>姓名</td>
        <td colspan="2"><span>{{ detailInfo.spokesmanName }}</span></td>
        <td>社团职务</td>
        <td><span>{{ dictToVal(dict2, detailInfo.spokesmanPost) }}</span></td>
        <td>电话</td>
        <td colspan="2"><span>{{ detailInfo.spokesmanPhone }}</span></td>
      </tr>
      <tr>
        <td class="td-head">党建工作情况</td>
        <td colspan="2">是否建立党组织</td>
        <td><span>{{ yesNoBool(detailInfo.partyOrganization) }}</span></td>
        <td>党员数</td>
        <td><span>{{ detailInfo.partyMembersNum }}</span></td>
        <td colspan="2">是否将党的建设和社会主义核心价值观写入章程</td>
        <td><span>{{ yesNoBool(detailInfo.partyBuildSocialistCoreValuesConstitution) }}</span></td>
      </tr>
      <tr>
        <td class="td-head">群团工作情况</td>
        <td>是否建立工会</td>
        <td class="width-td"><span>{{ yesNoBool(detailInfo.establishingTradeUnions) }}</span></td>
        <td>是否建立团组织</td>
        <td><span>{{ yesNoBool(detailInfo.establishingTeam) }}</span></td>
        <td>是否建立妇联</td>
        <td><span>{{ yesNoBool(detailInfo.establishingWomenFederation) }}</span></td>
        <td>群团组织活动次数</td>
        <td><span>{{ detailInfo.teamActivitieNum }}</span></td>
      </tr>
      <tr>
        <td class="td-head" rowspan="2">机构设置</td>
        <td colspan="2">分支机构数</td>
        <td colspan="2"><span>{{ detailInfo.branchNum }}</span></td>
        <td colspan="2">其中本年度新设立分支（代表）机构数</td>
        <td colspan="2"><span>{{ detailInfo.branchNum }}</span></td>
      </tr>
      <tr>
        <td colspan="2">代表机构数</td>
        <td><span>{{ detailInfo.representativeNum }}</span></td>
        <td colspan="2">办事机构数</td>
        <td><span>{{ detailInfo.workNum }}</span></td>
        <td>实体机构数</td>
        <td><span>{{ detailInfo.entityNum }}</span></td>
      </tr>
      <tr>
        <td class="td-head" rowspan="6">相关收支、职能和本年度重大活动情况</td>
        <td colspan="2">会费收入</td>
        <td colspan="2"><span>{{ detailInfo.membershipFees }}</span></td>
        <td colspan="2">是否参与乡村振兴工作</td>
        <td colspan="2"><span>{{ yesNoBool(detailInfo.countryRevitalization) }}</span></td>
      </tr>
      <tr>
        <td colspan="8">举办公益慈善活动（ <span>{{ detailInfo.publicWelfareCharitableNum }}</span> ）项</td>
      </tr>
      <tr>
        <td colspan="4">法律法规规章中明确规定的职能（ <span>{{ detailInfo.lawsFunctionNum }}</span> ）项</td>
        <td colspan="4">行政机关委托授权的事项（ <span>{{ detailInfo.administrationAuthorizationNum }}</span> ）项</td>
      </tr>
      <tr>
        <td colspan="4">举办展览会、博览会、交易会活动（ <span>{{ detailInfo.expositionTransactionNum }}</span> ）项</td>
        <td colspan="4">举办研讨会、论坛活动（ <span>{{ detailInfo.workshopForumActivitiesNum }}</span> ）项</td>
      </tr>
      <tr>
        <td colspan="8">经批准举办评比达标表彰活动（ <span>{{ detailInfo.evaluationCommendationNum }}</span> ）项</td>
      </tr>
      <tr>
        <td colspan="8">
          举办培训、职称评审、认证、鉴定等活动（ <span>{{ detailInfo.trainAuthenticationAppraisalNum }}</span> ）项
        </td>
      </tr>
    </table>
  </div>
</template>

<script setup lang="ts">
import TbTitle from '@/views/yearCheck/components/TbTitle.vue'
import { reactive, ref, inject, getCurrentInstance } from 'vue'
const { getDetailInfo } = inject('getDetailInfo')
import { getDictClubPositions, getDictAll, getDictPolitics, getDictXueli, getDictSecretaryPromotion } from '@/api/dict/index'
const { proxy } = getCurrentInstance();
const yesNoBool = proxy.$yesNoBool

const dict1 = ref([])
const dict2 = ref([])
const dict3 = ref([])
const dict4 = ref([])
const dict5 = ref([])
const dict6 = ref([])
let getDictInfo = () => {
  //社会组织类型
  getDictAll('socialOrganizationType').then(res => {
    console.log(res)
    dict1.value = res.data
  })
  //社团职务
  getDictClubPositions().then(res => {
    dict2.value = res.data
  })
  //政治面貌
  getDictPolitics().then(res => {
    dict3.value = res.data
  })
  //行业分类
  getDictAll('industryClass').then(res => {
    dict4.value = res.data
  })
  //秘书长产生方式
  getDictSecretaryPromotion().then(res => {
    dict5.value = res.data
  })
  getDictXueli().then(res => {
    dict6.value = res.data
  })
}

getDictInfo()

const dictToVal = (dictList, val) => {
  for (let i = 0; i < dictList.length; i++) {
    if (val == dictList[i].id) {
      return dictList[i].name
    }
  }
}

let detailInfo = reactive({})
getDetailInfo().then(res => {
  Object.assign(detailInfo, res.data)
})

</script>
<style lang="scss" scoped>
.msg-tip {
  padding: 20px 0;
  color: #000;
  font-family: '微软雅黑';
}

table {
  border-spacing: 0px;
  width: 100%;
  border-top: 1px solid #999;
  border-left: 1px solid #999;
  color: #000;

  thead {
    background: #f5f7fa;
    color: rgb(37, 43, 53);

    th {
      border-right: 1px solid #999;
      border-bottom: 1px solid #999;
      text-align: center;
      height: 40px;
    }
  }

  tbody {
    td {
      height: 40px;
      border-right: 1px solid #999;
      border-bottom: 1px solid #999;
      text-align: center;

      &.td-head {
        background: #f5f7fa;
      }
    }
  }
}
</style>
